package com.issoft.studentresitor.controller.admin;

import com.issoft.studentresitor.domain.pojo.Result;
import com.issoft.studentresitor.domain.vo.ReportVo;
import com.issoft.studentresitor.service.IMajorService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/report")
@Api(tags = "报表管理")
public class ReportController {
    @Autowired
    private IMajorService majorService;
    @ApiOperation("查询各专业的人数")
    @GetMapping("/queryMajorCount")
    public Result queryMajorCount(){
        List<ReportVo> reportVoList = majorService.queryMajorCount();
        return Result.success(reportVoList);
    }
    @ApiOperation("查询各班级人数")
    @GetMapping("/queryClazzCount")
    public Result queryClazzCount(){
        List<ReportVo> reportVoList = majorService.queryClazzCount();
        return Result.success(reportVoList);
    }
    @ApiOperation("查询各寝室人数")
    @GetMapping("/queryDormCount")
    public Result queryDormCount(){
        List<ReportVo> reportVoList = majorService.queryDormCount();
        return Result.success(reportVoList);
    }
    @ApiOperation("查询缴费人数")
    @GetMapping("/queryPayCount")
    public Result queryPayCount(){
        List<ReportVo> reportVoList = majorService.queryPayCount();
        return Result.success(reportVoList);
    }
}
